"""
@Project ：Python_learning 
@File    ：136.只出现一次的数字.py
@Author  ：zhupp
@Date    ：2024/12/20 17:09 
"""
from functools import reduce
from typing import List


class Solution:
    def singleNumber(self, nums: List[int]) -> int:
        # single = []
        # for num in nums:
        #     if num not in single:
        #         single.append(num)
        #     else:
        #         single.remove(num)
        # return single[0]
        return reduce(lambda x, y: x ^ y, nums)
s = Solution()
print(s.singleNumber([1,2,2,3,3,1,8]))